import { validEmail, validPhone } from "@/utils/validate";
export const graphCaptcha  = {
  data() {
    return {
      dialogCaptchaVisible: false,
    }
  },
  methods: {
    closeDialog() {
      this.dialogCaptchaVisible= false
    },
    changeDialogCaptchaVisible(account) {
      console.log(account);
      if(account == "") {
        this.$message.error("请输入您的账号！")
        return false
      }else if(validEmail(account) || validPhone(account)) {
        this.dialogCaptchaVisible = !this.dialogCaptchaVisible;
      }else {
        this.$message.error("请输入正确的手机号或邮箱")
        return false
      }
    },
  }
}
